<template>
	<view class="content">
		<view class="no" v-if="list.length == 0">暂无提现记录</view>
		<view class="group" v-else>
			<view class="title">
				<text>提现日期</text>
				<text>提现金额</text>
			</view>
			<view class="colmun" v-for="item in list">
				<text>{{item.createtime_text}}</text>
				<text class="status">{{item.state_text}}</text>
				<text class="num">{{item.money}}</text>
			</view>
		</view>
		<view class="footer">
			<!-- <view class="rich">提现说明：</view> -->
			<rich-text class="rich" :nodes="html"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				page: 1,
				last_page: 1,
				html: ''
			}
		},
		onReachBottom() {
			if(this.last_page - this.page >= 0){
				this.page++;
				this.loadData()
			}
		},
		onLoad() {
			this.loadData();
			this.loadDesc()
		},
		methods: {
			loadData(){
				this.$http.post('/api/cash/index',{
					page: this.page,
					limit: '25'
				}).then(res => {
					console.log(res)
					if(this.page == 1){
						this.list = res.data.data.data;
					}else{
						this.list = this.list.concat(res.data.data.data)
					}
					this.last_page = res.data.data.last_page;
				})
			},
			loadDesc(){
				this.$http.post('/api/cash/tips').then(res => {
					console.log(res)
					this.html = res.data.data.tips
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.content{
	background:rgba(248,248,248,1);
	min-height: 100vh;
	padding-top: 30rpx;
	box-sizing: border-box;
}
.group{
	width: 100%;
	background:rgba(255,255,255,1);
	padding: 30rpx;
	box-sizing: border-box;
}
.title{
	display: flex;
	justify-content: space-between;
	align-items: center;
	text{
		font-size:16px;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(102,102,102,1);
	}
}
.colmun{
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 1px solid #F1F1F1;
	padding: 40rpx 0;
	box-sizing: border-box;
	text{
		font-size:15px;
		font-family:PingFang SC;
		font-weight:bold;
		color:rgba(52,52,52,1);
	}
	.status{
		font-weight:400;
		color:rgba(64,196,120,1);
	}
	.num{
		font-size:16px;
		font-family:PingFang SC;
		font-weight:bold;
		color:rgba(64,196,120,1);
	}
}
.footer{
	margin-top: 50rpx;
	width: 100%;
	padding: 0 30rpx;
	box-sizing: border-box;
	.rich{
		font-size:16px;
		font-family:PingFang SC;
		font-weight:bold;
		color:rgba(52,52,52,1);
	}
}
</style>
